using UnityEngine;

public delegate void RegistFunction(object arg);

public class Facade
{
	private static Facade _instance;
	public static Facade Instance
	{
		get
		{
			if (_instance == null)
				_instance = new Facade();
			return _instance;
		}
	}

	// Use this for initialization
	private readonly EventDispatcher _eventDispatcher = new EventDispatcher();

	public void RegistEvent(int EventID, RegistFunction pFunction)
	{
		_eventDispatcher.RegistEvent(EventID, pFunction);
	}

	public void UnRegistEvent(int EventID, RegistFunction pFunction)
	{
		_eventDispatcher.UnRegistEvent(EventID, pFunction);
	}

	public void SendEvent(int EventID, object arg)
	{
		_eventDispatcher.HandleEvent(EventID, arg);
	}
}

